﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChanPin_TJ.aspx.cs" Inherits="syc.Store.ChanPin_TJ" %>
<html>
<body>

<script type="text/javascript" language="javascript" src="/common.js"></script>

    <form id="form1" runat="server">
        <div id="wintop" class="wintop">产品库存统计</div>
        <asp:Panel ID="Panel1" runat="server" CssClass="panel" Visible="false">
            <asp:Button ID="Button_New" runat="server" Text="新  增" CssClass="button" UseSubmitBehavior="False" />
        </asp:Panel>
        <asp:Panel ID="Panel2" runat="server" CssClass="panel" Visible="False">
        <table style="width: 100%">
            <tr>
                <td width=400>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
            ></asp:SqlDataSource>

                    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataSourceID="SqlDataSource1" 
                        GridLines="None" Width="450px" DefaultMode="Edit">
                        <Fields>
                            <asp:TemplateField HeaderText="品名：" InsertVisible="False">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("品名") %>'></asp:Label>
                                </ItemTemplate>
                                <ControlStyle CssClass="textbox" />
                                <HeaderStyle CssClass="detailheader" />
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="库存总重：" SortExpression="总重">
                                <ItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("总重","{0:.00}") %>'></asp:TextBox>
                                </ItemTemplate>
                                <ControlStyle CssClass="textbox" />
                                <HeaderStyle CssClass="detailheader" />
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="库存总长：" SortExpression="总长">
                                <ItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("总长","{0:.00}") %>'></asp:TextBox>
                                </ItemTemplate>
                                <ControlStyle CssClass="textbox" />
                                <HeaderStyle CssClass="detailheader" />
                            </asp:TemplateField>
                            
                        </Fields>
                    </asp:DetailsView>

                </td>

            </tr>

        </table>

    </asp:Panel>
    
    <div class="gridframe">
        <div class="gridview">
        
            <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#d0d0d0">
	            <tr>
		            <td class="grid-title">品名</td>
		        </tr>
		        <tr>
		            <td class="grid-back">
                        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
                            SelectCommand="SELECT * FROM [产品]"></asp:SqlDataSource>
                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                            AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" 
                            DataSourceID="SqlDataSource2" 
                            GridLines="None" ondatabound="GridView1_DataBound" 
                            onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                            UseAccessibleHeader="False">
                            <PagerSettings Visible="False" />
                            <RowStyle CssClass="grid-row-normal" />
                            <Columns>
                                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False"  ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ReadOnly="True" SortExpression="ID" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle HorizontalAlign="Center" CssClass="grid" Width="80px"></ItemStyle>
                                </asp:BoundField>
                                <asp:BoundField DataField="品名" HeaderText="品名" SortExpression="品名" ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-Width="160" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid" Width="160px"></ItemStyle>
                                </asp:BoundField>

                                <asp:BoundField DataField="规格" HeaderText="规格" SortExpression="规格" ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                    ItemStyle-Width="160" >
<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle CssClass="grid" Width="160px"></ItemStyle>
                                </asp:BoundField>


                                <asp:TemplateField HeaderText="操作" ShowHeader="true" ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header" ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Button ID="Button1" runat="server" CommandName='<%# Eval("ID") %>' CommandArgument='<%# Eval("品名")+ "(" +Eval("规格")+")"%>'
                                            Text="库存统计" CssClass="wsbutton" oncommand="Button1_Command" />
                                    </ItemTemplate>

<HeaderStyle CssClass="grid-header"></HeaderStyle>

<ItemStyle HorizontalAlign="Center" CssClass="grid" Width="80px"></ItemStyle>
                                </asp:TemplateField>
                            </Columns>
                          </asp:GridView>
		            </td>
	            </tr>
	            <tr>
		            <td>
		                <table width="100%">
		                    <tr>
		                        <td class="pagebar">
                                    <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" 
                                        CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                    <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页" 
                                        CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                    <input type="button" class="page-split" />第<asp:TextBox ID="TextBox_Pager" runat="server" CssClass="pageturn" 
                                        ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" /><asp:Label ID="Label_Pages" runat="server"></asp:Label><input type="button" class="page-split" />
                                    
                                    <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页" 
                                        CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                    <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页" 
                                        CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" />
                                </td>
                                <td align="right">
                                    <asp:Label ID="Label_Total" runat="server" CssClass="grid_totalrows"></asp:Label>
                                </td>
                            </tr>
                       </table>

		            </td>
	            </tr>
            </table>
            

        </div>
    </div>
    
    </form>
<script>
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "textbox") {
            textboxs[i].onchange = function(e) { this.className = "textbox-changed"; };
            textboxs[i].onfocus = function(e) { this.select(); };
        }
        else if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }

    }
    var rows = document.getElementsByTagName("tr");
    for (i = 0; i < rows.length; i++) {

        if (rows[i].className == "grid-row-normal") {
            rows[i].onmouseover = function() { this.className = "grid-row-bright"; };
            rows[i].onmouseout = function() { this.className = "grid-row-normal"; };
        }
    }
    var tds = document.getElementsByTagName("td");
    for (i = 0; i < tds.length; i++) {
        if (tds[i].className == "detailheader") {
            tds[i].innerHTML = tds[i].innerHTML.replace("*", "<span class=required>*</span>");
        }
    }
</script>
</body>
</html>
